<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>属性选择器</title>
    <script src="../../js/jquery.1.8.3.min.js"></script>
    <script>
        $(function () {
            var node = $("input[name='username']");
            for (var i = 0; i <node.length ; i++) {
                node[i];
                console.log("输出:" + node[i].value)
            }

           var node1 =  $("input[id]");
            for (var i = 0; i <node1.length; i++) {
                console.log(node1[i].value)
            }

           var node2 = $("input[id][value$='java']");
            for (var i = 0; i <node2.length; i++) {
                console.log(node2[i].value)
            }
        })
    </script>
</head>
<body>
    <input id="username" type="checkbox" name="username" value="钱多多">
    <input type="checkbox" name="username" value="钱太多">
    <input type="checkbox" name="password" value="123456">
    <input type="checkbox" id="java" name="java" value="val java">
</body>
</html>